package Map;

/*
 * Author: JacksonCoder
 * FileName: demo
 * Version: 1.0.0
 * Date: 2025/7/10
 */

import java.util.HashMap;
import java.util.Map;

public class demo {
    public static void main(String[] args) {
        Map<Integer, Integer> map = new HashMap<>();
        map.put(1, 10);
        map.put(2, 20);
        map.put(3, 30);
        System.out.println(map);

        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            System.out.println(entry.getKey() + " = " + entry.getValue());
        }

        boolean key = map.containsKey(1);
        if (key) {
            System.out.println(map.get(1));
        }

        boolean value = map.containsValue(20);
        if (value) {
            System.out.println(value + "value " + "= 20");
        }

        map.forEach((key1, value1) -> System.out.println(key1 + " = " + value1));


    }
}
